﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;

namespace SLControlLibrary.Resources.Controls.Calendar.OutlookCalendar.BusinessObjects
{
    public class AppointmentList : ObservableCollection<Appointment>
    {
        #region Constructor
        public AppointmentList()
        {
        }
        #endregion

        #region Methods
        public void AddAppointmentToList(Appointment _Appointment)
        {
            this.Add(_Appointment);
        }

        public void AddAppointmentToList(List<Appointment> _Appointments)
        {
            base.Clear();

            foreach (Appointment _Appointment in _Appointments)
                AddAppointmentToList(_Appointment);
        }

        public List<Appointment> ToList()
        {
            List<Appointment> _Appointments = new List<Appointment>();
            foreach (Appointment _Appointment in this.Items)
                _Appointments.Add(_Appointment);

            return _Appointments;
        }

        public AppointmentList ToObservaleCollection(List<Appointment> _Appointments)
        {
            foreach (Appointment _Appointment in _Appointments)
                this.Add(_Appointment);

            return this;
        }
        #endregion
    }
}
